<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>vue中事件学习</title>
	</head>
	<body>
		
		<div id="app">
			
			{{num}}
			<h1 v-text="num"></h1>
			
			<br>
			
			<button v-on:click="num++">自增</button>
			<button @click="num++">自增</button>
			<button @click="addNum">方法自增</button><br />
			<button @click="addNum2">方法自增2</button><br />
			<button @click="addNum3">方法自增3</button>
		</div>
		
		<script src="../js/vue.js"></script>
		<script>
			const app=new Vue({
				el:"#app",
				data:{
					num:1
				},
				methods:{
					addNum:function(){
						this.num++
					},
					addNum2(){
						this.num+=3
					},
					addNum3(){
							this.num+=10
					}
				}
			})
		</script>
	</body>
</html>
